import request from "../utils/request.js";

// 定义删除角色的api
export const api_del=(url)=>request.delete(`roles/${url.id}`);

// 定义编辑的api
export const api_update=(data)=>request.put(`roles/${data.id}`,data);

// 定义删除指定角色的权限api
export const api_delete=({roleId,rightId})=>request.delete(`roles/${roleId}/rights/${rightId}`);

// 定义添加角色的api
export const api_add=(data)=>request.post(`roles`,data);

// 定义列表显示和树状显示权限的api
export const api_right=({url})=>request.get(`rights/${url}`);

// 定义给角色分配权限的api
export const api_setright=(data)=>request.post(`roles/${data.roleId}/rights`,data)